<?php $this->load->module('index/index/head');?>
<?php $this->load->module('member/index/center_head',$extra);?>
    <link rel="stylesheet" href="<?php echo URLPRE;?>static/template/bai/css/tuangou.css" />


    <!--container-->
    <div class="container">
    <div class="row">
        <div class="col-md-12">
            <div class="breadcrumb-box">
                <span class="breadcrumb-new-style">您所在的位置：</span>
                <ol class="breadcrumb ol-bgc">
                    <li><a href="<?php echo site_url('member/index/center')?>">会员中心</a></li>
                    <li class="active">订单详情</li>
                </ol>
            </div>
        </div>

        <?php $this->load->module('member/index/center_left',$extra);?>
        <div class="col-md-9 member-center-box-margin">
        <div class="">
            <div class="hy_xinnei_rt_lietit">机票订单详情</div>
            <div class="hy_xinnei_rt_liecon">
                <div class="article">
                    <div class="section">
                        <div class="title"><strong>订单信息</strong></div>
                        <div class="zlf_table">
                            <table width="100%" class="table_form" style="margin-bottom:0">
                                <tr>
                                    <th width="100">订单编号： </th>
                                    <td>&nbsp;<?php echo $order_info['order_sn'];?></td>
                                </tr>
                                <tr>
                                    <th>下单时间： </th>
                                    <td>&nbsp;<font color="red"><?php echo $order_info['add_time'];?></font></td>
                                </tr>
                                <tr>
                                    <th>订单总价： </th>
                                    <td>&nbsp;<font><?php echo price_format($order_info['order_account']);?></font></td>
                                </tr>
                                <tr>
                                    <th>已支付金额： </th>
                                    <td>&nbsp;<font><?php echo price_format($order_info['paid_account']);?></font></td>
                                </tr>
                                <tr>
                                    <th>未支付金额： </th>
                                    <td>&nbsp;<font color="red"><?php echo price_format($order_info['order_account']-$order_info['paid_account']);?></font></td>
                                </tr>
                                <tr>
                                    <th>订单备注： </th>
                                    <td>&nbsp;<?php echo $order_info['order_note'] ;?></td>
                                </tr>
                                <tr class="zlf_border_none">
                                    <th>订单状态： </th>
                                    <td>&nbsp;
                                        <?php if($order_info['pay_status']==3&&$flight_server_info['Status']==4):?>&nbsp;<font style="color:green;">订单完成</font><?php endif;?>
                                        <?php if($order_info['order_status']==3):?>&nbsp;已关闭订单<?php endif;?>
                                        <?php if($order_info['pay_status']!=3&&$order_info['order_status']!=3&&!$flight_server_info['Status']):?>
                                            <a href="<?php echo site_url('flight/index/pay_initialize?order_id='.$order_info['order_id'].'&order_sn='.$order_info['order_sn'].'&pnr='.$flight_info['pnr']);?>" target="_blank" style="color:green">
                                                立即付款</a>
                                        <?php endif;?>

                                        <?php if($order_info['order_status']!=3&&$order_info['pay_status']==1):?>
                                            <?php if(isset($flight_server_info['Status'])):?>
                                            <?php if($flight_server_info['Status']==0):?>
                                            &nbsp;<a href="javascript:;" style="color:red" data-uri="<?php echo $ajax_order_status_url;?>" id="cancelOrderBtn">取消订单</a>
                                            <?php endif ;?>
                                            <?php endif ;?>
                                        <?php endif;?>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <div class="bk10"></div>
                    <div class="section">
                        <div class="title"><strong>机票信息</strong></div>
                        <div class="zlf_table">
                            <table width="100%" class="table_form" style="margin-bottom:0">
                                <tr>
                                    <th width="150">航班： </th>
                                    <td>&nbsp;<?php echo $flight_info['flight'];?>/<?php echo airline_word_to_name($flight_info['flight']);?></td>
                                </tr>
                                <tr>
                                    <th>出发机场： </th>
                                    <td>&nbsp;<font><?php echo $flight_info['sairport'];?></font></td>
                                </tr>
                                <tr>
                                    <th>落地机场： </th>
                                    <td>&nbsp;<font><?php echo $flight_info['eairport'];?></font></td>
                                </tr>
                                <tr>
                                    <th>出发日期： </th>
                                    <td>&nbsp;<font><?php echo $flight_info['date'];?></font></td>
                                </tr>
                                <tr>
                                    <th>起飞时间- 落地时间： </th>
                                    <td>&nbsp;<font><?php echo $flight_info['stime']?>----<?php echo $flight_info['etime']?></font></td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <div class="bk10"></div>
                    <div class="section">
                        <div class="title"><strong>舱位信息</strong></div>
                        <div class="zlf_table">
                            <table style="table-layout:fixed;margin-bottom:0;">
                                <thead>
                                <tr>
                                    <th class="algin_l">舱位</th>
                                    <th class="algin_l">舱位票面价</th>
                                    <th class="algin_l">折扣</th>
                                    <th class="algin_l">舱位结算价(元/人)</th>
                                    <th class="algin_l">机建燃油费</th>
                                    <th class="algin_l">人数</th>
                                    <th class="algin_l">小计(元)</th>
                                </tr>
                                </thead>
                                <tr>
                                    <td class="algin_l"><?php echo $flight_info['cabin'];?></td>
                                    <td class="algin_l zlf_price"><?php echo price_format($flight_info['price']);?></td>
                                    <td class="algin_l"><?php echo $flight_info['grow_discount'];?>%</td>
                                    <td class="algin_l zlf_price"><?php echo price_format($flight_info['unit_price']);?></td>
                                    <td class="algin_l"><?php echo $flight_info['tax'];?></td>
                                    <td class="algin_l"><?php echo $flight_info['pcount'];?></td>
                                    <td class="algin_l zlf_price"><?php echo price_format($flight_info['pcount']*($flight_info['unit_price']+$flight_info['tax']));?></td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <?php if(isset($tourist_info)&&!empty($tourist_info)):?>
                    <div class="bk10"></div>
                    <div class="section">
                        <div class="title"><strong>乘机人信息</strong></div>
                        <div class="zlf_table">
                            <table style="table-layout:fixed;margin-bottom:0;">
                                <thead>
                                <tr>
                                    <th class="algin_l">乘机人姓名</th>
                                    <th class="algin_c">证件类型</th>
                                    <th class="algin_c">证件号码</th>
                                    <th class="algin_c">手机号码</th>
                                </tr>
                                </thead>
                                <?php foreach($tourist_info as $val):?>
                                <tr>
                                    <td class="algin_l"><?php echo $val['name'];?></td>
                                    <td class="algin_c">
                                        <?php if($val['id_card_type']==1):?>身份证<?php endif;?>
                                        <?php if($val['id_card_type']==2):?>护照<?php endif;?>
                                        <?php if($val['id_card_type']==3):?>军官证<?php endif;?>
                                    </td>
                                    <td class="algin_c"><?php echo $val['id_number'];?></td>
                                    <td class="algin_c"><?php echo $val['phone_num'];?></td>
                                </tr>
                                <?php endforeach;?>
                            </table>
                        </div>
                    </div>
                    <?php endif;?>
                    <?php if(isset($refund_info)&&!empty($refund_info)):?>
                    <div class="bk10"></div>
                    <div class="section">
                        <div class="title"><strong>退废详情</strong></div>
                        <div class="zlf_table">
                            <table style="table-layout:fixed;margin-bottom:0;">
                                <thead>
                                <tr>
                                    <th class="algin_l">退款状态</th>
                                    <th class="algin_l">乘客姓名</th>
                                    <th class="algin_l">票号</th>
                                    <th class="algin_l">退废原因</th>
                                    <th class="algin_l">退废备注</th>
                                    <th class="algin_l">退换金额</th>
                                    <th class="algin_l">退款批次</th>
                                </tr>
                                </thead>
                                <tr>
                                    <td class="algin_l">
                                        <?php if($refund_info['Status']=='0'):?>初始化<?php endif;?>
                                        <?php if($refund_info['Status']=='1'):?>废票<?php endif;?>
                                        <?php if($refund_info['Status']=='2'):?>退票<?php endif;?>
                                        <?php if($refund_info['Status']=='3'):?>已废<?php endif;?>
                                        <?php if($refund_info['Status']=='4'):?>已退<?php endif;?>
                                        <?php if($refund_info['Status']=='5'):?>审核<?php endif;?>
                                    </td>
                                    <td class="algin_l"><?php echo $refund_info['PassengerName'];?></td>
                                    <td class="algin_l"><?php echo $refund_info['TicketNo'];?></td>
                                    <td class="algin_l"><?php echo $refund_info['Cause'];?></td>
                                    <td class="algin_l"><?php echo $refund_info['Remark'];?></td>
                                    <td class="algin_l"><?php echo $refund_info['ReturnPrice'];?></td>
                                    <td class="algin_l zlf_price"><?php echo price_format($refund_info['BatchNoTopType']);?></td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <?php endif ;?>
                    <div class="bk10"></div>
                    <div class="section">
                        <div class="title"><strong>联系人信息</strong></div>
                        <div class="zlf_table">
                            <table width="100%" class="table_form" style="margin-bottom:0">
                                <tr>
                                    <th width="100">姓名： </th>
                                    <td>&nbsp;<?php echo $contact_info['name'];?></td>
                                </tr>
                                <?php if(isset($contact_info['phone_num'])&&!empty($contact_info['phone_num'])):?>
                                    <tr>
                                        <th>手机号码： </th>
                                        <td>&nbsp;<?php echo $contact_info['phone_num'];?></td>
                                    </tr>
                                <?php endif;?>
                                <?php if(isset($contact_info['email'])&&!empty($contact_info['email'])):?>
                                    <tr>
                                        <th>邮件地址： </th>
                                        <td>&nbsp;<?php echo $contact_info['email'];?></td>
                                    </tr>
                                <?php endif;?>
                            </table>
                        </div>
                    </div>
                    <div class="bk10"></div>
                    <div class="section">
                        <div class="title"><strong>退票说明</strong></div>
                        <div class="zlf_table">
                            <?php echo $flight_info['return'] ;?>
                        </div>
                    </div>
                    <div class="bk10"></div>
                    <div class="section">
                        <div class="title"><strong>改签说明</strong></div>
                        <div class="zlf_table">
                            <?php echo $flight_info['change'] ;?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        </div>
    </div>
    </div>
<script type="text/javascript">
$(function(){
    //取消订单
    $('#cancelOrderBtn').click(function(){
        var uri = $(this).attr("data-uri");
        var that = this;
        $.dialog.confirm("你确认要取消该订单么?", function () {
            $.ajax({
                url:uri,
                cache:false,
                dataType:'json',
                type:'POST',
                data:{},
                success:function(msgObj){
                    window.location.reload();
                    return false;
                }
            });
        }, function () {
        });
    })
    $('#payOrderBtn').click(function(){
        var uri = $(this).attr("data-uri");
        var that = this;
        $.dialog.confirm("点击确定刷新页面,查看订单状态", function () {
           window.location.reload();
        }, function () {

        });
    })
})
</script>
<?php $this->load->module('index/index/foot');?>